<?php
/**
 * PHPTyrant CLI Test Script
 *
 * Please start tokyo tyrant by 'ttserver' (without parameters, or with '-dmn' for daemon mode)
 * before running this script from the command line.
 *
 * PHP version 5
 *
 * @category  PHP
 * @package   Tokyo_Tyrant
 * @author    Tamas Kalman <ktamas77@gmail.com>
 * @license   BSD
 */

error_reporting(E_ALL);

require "../phptyrant.inc.php";

echo "PHPTyrant test\n";

$tyrant = new Tyrant();

echo "Opening Tyrant...\n";
$tyrant->open();

$testkey = "test1";
$testdata = "testdata01";
echo "Writing $testkey => $testdata\n";
$tyrant->put($testkey, $testdata);

echo "Reading test1 => ";
$var = $tyrant->get($testkey);
echo $var."\n"; 

echo "Closing connection...\n";
$tyrant->close();

echo "Done.\n";

?>